<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>合同中止documentStop </title>
	</head>
	<link rel="stylesheet" href="../css/common.css" />

	<style>
		.box{
			text-align:center;
		}
		
		input{
			width:200px;
			height:22px;
			margin:40px auto;
			border:1px solid #999;
			font-family:"微软雅黑";
		}
		.btn{
			width:200px;
			padding-top:10px;
			margin:0 auto;
			text-align:center;
		}
		.query{
			margin-right:60px;
			
		}
		.cancel{
			background:#a09f9d!important;
			
		}
	</style>
	<body>
		<div class='box'><input class='datespicker date' type='text'  onFocus="new WdatePicker({dateFmt:'yyyy-MM-dd'})"/></div>
		<div class='btn'><i class='Dolo_btn query'>确定</i><i class='Dolo_btn cancel'>取消</i></div>
		
	</body>
		<script type="text/javascript" src="../js/jquery-1.12.4.js" ></script>
		<script type="text/javascript" src="../layer-v2.4/layer/layer.js" ></script>
		<!-- 引入my97日期时间控件 -->
		<script type="text/javascript" src="../js/My97DatePicker/WdatePicker.js" charset="utf-8"></script>	
		<script type="text/javascript" src="../js/common.js" ></script>
		<script>
		
			$(".query").click(function(){
				
				var documentId = getHref().documentId;
				var date = $(".date").val();
				layer.msg('中止中...', {icon: 16,shade: 0.01});
				$.ajax({
					type:"post",
					url:"../contract/"+documentId+"/discontinue?date="+date+"&temp="+Math.random(),
					async:true,
					dataType:"json",
					success:function(data){
						if(data.status=="1001"){
							layer.msg('已中止', {icon: 1,time:1000},function(){
								closeWin()
							});
						}else{
							layer.msg('合同中止失败', {icon: 2,time:2000});
						}
					}			
				});		
			})
			$(".cancel").click(function(){
				closeWin()
			})
		
		/* 
		layer.confirm('确认中止该合同？', {
		   	btn: ['确定','取消'] //按钮
		}, function(){
			$.ajax({
				type:"post",
				url:"../contract/"+documentId+"/discontinue?date=2016-01-01",
				async:false,
				dataType:"json",
				success:function(data){
					if(data.status=="1001"){
						layer.msg('已中止', {icon: 1,time:1000},function(){
							location.reload();
						});
					}else{
						layer.msg('合同中止失败', {icon: 2});
					}
				}			
			});		
			
		}, function(){
			
		});	 */
		</script>
		
			
</html>
